<?php

namespace App\Http\Resources\Api;

use Illuminate\Http\Resources\Json\Resource;

class Article extends Resource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'title'=>$this->title,
            'content'=>$this->content,
         //   'admin'=>$this->when($this->)
        ];
    //    return parent::toArray($request);
    }
    public function with($request)
    {
        return [
            'code'=>1,
            'status'=>'success'
        ];
    }
}
